//
//  JGHomeDropdown.h
//  JGMeiTuanHD
//
//  Created by JJetGu on 15/9/10.
//  Copyright (c) 2015年 Free. All rights reserved.
//

#import <UIKit/UIKit.h>

@class JGHomeDropdown;

@protocol JGHomeDropdownDataSource <NSObject>

@required
/**
 *  左边表格一共有多少行
 */
-(NSInteger)numberOfRowsInMainTable:(JGHomeDropdown *)homeDropdown;
/**
 *  左边表格每一行的标题
 *  @param row          行号
 */
-(NSString *)homeDropdown:(JGHomeDropdown *)homeDropdown titleForRowInMainTable:(NSInteger)row;
/**
 *  左边表格每一行的子数据
 *  @param row          行号
 */
- (NSArray *)homeDropdown:(JGHomeDropdown *)homeDropdown subdataForRowInMainTable:(NSInteger)row;

@optional
/**
 *  左边表格每一行的图标
 *  @param row          行号
 */
- (NSString *)homeDropdown:(JGHomeDropdown *)homeDropdown iconForRowInMainTable:(NSInteger)row;
/**
 *  左边表格每一行的选中图标
 *  @param row          行号
 */
- (NSString *)homeDropdown:(JGHomeDropdown *)homeDropdown selectedIconForRowInMainTable:(NSInteger)row;

@end

@protocol JGHomeDropdownDelegate <NSObject>

@optional
-(void)homeDropdown:(JGHomeDropdown *)homeDropdown didSelectRowInMainTable:(NSInteger)row;
- (void)homeDropdown:(JGHomeDropdown *)homeDropdown didSelectRowInSubTable:(NSInteger)subrow inMainTable:(int)mainRow;

@end


@interface JGHomeDropdown : UIView

+ (instancetype)dropdown;

@property (nonatomic, weak) id<JGHomeDropdownDataSource> dataSource;
@property (nonatomic, weak) id<JGHomeDropdownDelegate> delegate;

@end
